//
//  ImageListCollectionViewCell.m
//  HuiWenMovie
//
//  Created by ios on 15/7/22.
//  Copyright (c) 2015年 ios. All rights reserved.
//

#import "ImageListCollectionViewCell.h"
#import "UIImageView+WebCache.h"
@implementation ImageListCollectionViewCell

- (instancetype)initWithFrame:(CGRect)frame
{
    self = [super initWithFrame:frame];
    
    if(self)
    {
        _ImageView = [[UIImageView alloc]initWithFrame:self.bounds];
        
        [self configureImageView];
        [self addSubview:_ImageView];
    }
    
    
    return  self;
}

- (void)configureImageView
{
    _ImageView.layer.cornerRadius = 5;
    _ImageView.layer.borderWidth = 1;
    _ImageView.layer.borderColor = [UIColor whiteColor].CGColor;
    _ImageView.layer.masksToBounds = YES;

}

- (void)setImageListModel:(ImageListModel *)imageListModel
{
    _imageListModel = imageListModel;
    
    [self setNeedsLayout];
}

- (void)layoutSubviews
{
    [super layoutSubviews];
    [_ImageView sd_setImageWithURL:[NSURL URLWithString:_imageListModel.image]];

}

@end
